"""

# 函数声明(包括参数)

def 函数名(形参1,形参2,...形参n):
   函数体

# 调用函数(包括参数)
函数名(实参1,实参2,...实参n)
"""


# 案例1:
# def add(x, y):
#     # x = 1
#     # y = 2
#     print(x + y)
#
#
# add(1, 2)
# add(10, 20)
# add(10, 20, 30)
# add(10)

# 案例2:
# def cal(start, end):  # 形式参数
#     # 计算1-n的累加和
#     ret = 0
#     for i in range(start, end + 1):
#         ret += i
#     print(ret)
#
# # cal(1, 100)
# cal(66, 88)
# cal(1000, 10000)


# 案例3:发送邮件

# def send_email(recipient, subject, content):
#     print("连接服务器")
#     print(f"收件人邮箱:{recipient}")
#     print(f"主题:{subject}")
#     print(f"内容:{content}")
#
#
# # send_email("alex@qq.com","重要通知","Alex，你已经被解雇，明天不用来公司了！")
# # send_email("alex@qq.com","Alex，你已经被解雇，明天不用来公司了！","重要通知")
#
# r = "alex@qq.com"
# c = "Alex，你已经被解雇,明天不用来公司了！"
# s = "重要通知"
# send_email(r, s, c)
#
# r = "yuan@qq.com"
# c = "Yuan老师，您太辛苦，给您涨薪十万元！"
# s = "重要通知"
# send_email(r, s, c)






